package cc.yugu.yhdw.common.protocol;

import cc.yugu.yhdw.common.protocol.msg02.*;
import cc.yugu.yhdw.common.protocol.msg03.*;
import cc.yugu.yhdw.common.protocol.msg04.Msg041000001;
import cc.yugu.yhdw.common.protocol.msg04.Msg041000002;
import cc.yugu.yhdw.common.protocol.msg04.Msg042000001;
import cc.yugu.yhdw.common.protocol.msg04.Msg042000002;
import cc.yugu.yhdw.common.protocol.msg05.*;
import cc.yugu.yhdw.common.protocol.msg06.Msg061000001;
import cc.yugu.yhdw.common.protocol.msg06.Msg062000001;

import java.util.HashMap;
import java.util.Map;

public enum MsgCode {
    MSG_021000001(21000001, Msg021000001.class),
    MSG_021000002(21000002, Msg021000002.class),
    MSG_021000003(21000003, Msg021000003.class),
    MSG_021000004(21000004, Msg021000004.class),
    MSG_021000005(21000005, Msg021000005.class),
    MSG_021000006(21000006, Msg021000006.class),
    MSG_021000007(21000007, Msg021000007.class),
    MSG_021000008(21000008, Msg021000008.class),
    MSG_021000009(21000009, Msg021000009.class),
    MSG_021000010(21000010, Msg021000010.class),
    MSG_021000011(21000011, Msg021000011.class),
    MSG_021000012(21000012, Msg021000012.class),
    MSG_021000014(21000014, Msg021000014.class),
    MSG_021000015(21000015, Msg021000015.class),
    MSG_021000016(21000016, Msg021000016.class),
//    MSG_021000017(21000017, Msg021000017.class),
    MSG_021000018(21000018, Msg021000018.class),
    MSG_021000019(21000019, Msg021000019.class),
    MSG_021000020(21000020, Msg021000020.class),
    MSG_021000021(21000021, Msg021000021.class),
    MSG_021000022(21000022, Msg021000022.class),
    MSG_021000023(21000023, Msg021000023.class),
    MSG_021000024(21000024, Msg021000024.class),
    MSG_021000025(21000025, Msg021000025.class),
    MSG_021000026(21000026, Msg021000026.class),
    MSG_021000027(21000027, Msg021000027.class),
    MSG_021000028(21000028, Msg021000028.class),
    MSG_021000029(21000029, Msg021000029.class),
    MSG_021000030(21000030, Msg021000030.class),
    MSG_021000031(21000031, Msg021000031.class),
    MSG_021000032(21000032, Msg021000032.class),
    MSG_021000033(21000033, Msg021000033.class),
    MSG_021000034(21000034, Msg021000034.class),
    MSG_021000035(21000035, Msg021000035.class),

    MSG_022000001(22000001, Msg022000001.class),
    MSG_022000002(22000002, Msg022000002.class),
    MSG_022000003(22000003, Msg022000003.class),
    MSG_022000004(22000004, Msg022000004.class),
    MSG_022000005(22000005, Msg022000005.class),
    MSG_022000006(22000006, Msg022000006.class),
    MSG_022000007(22000007, Msg022000007.class),
    MSG_022000008(22000008, Msg022000008.class),
    MSG_022000009(22000009, Msg022000009.class),
    MSG_022000010(22000010, Msg022000010.class),
    MSG_022000011(22000011, Msg022000011.class),
    MSG_022000012(22000012, Msg022000012.class),
    MSG_022000014(22000014, Msg022000014.class),
    MSG_022000015(22000015, Msg022000015.class),
    MSG_022000016(22000016, Msg022000016.class),
//    MSG_022000017(22000017, Msg022000017.class),
    MSG_022000018(22000018, Msg022000018.class),
    MSG_022000019(22000019, Msg022000019.class),
    MSG_022000020(22000020, Msg022000020.class),
    MSG_022000021(22000021, Msg022000021.class),
    MSG_022000022(22000022, Msg022000022.class),
    MSG_022000023(22000023, Msg022000023.class),
    MSG_022000024(22000024, Msg022000024.class),
    MSG_022000025(22000025, Msg022000025.class),
    MSG_022000026(22000026, Msg022000026.class),
    MSG_022000027(22000027, Msg022000027.class),
    MSG_022000028(22000028, Msg022000028.class),
    MSG_022000029(22000029, Msg022000029.class),
    MSG_022000030(22000030, Msg022000030.class),
    MSG_022000031(22000031, Msg022000031.class),
    MSG_022000032(22000032, Msg022000032.class),
    MSG_022000033(22000033, Msg022000033.class),
    MSG_022000034(22000034, Msg022000034.class),
    MSG_022000035(22000035, Msg022000035.class),

    MSG_031000001(31000001, Msg031000001.class),
    MSG_031000002(31000002, Msg031000002.class),
    MSG_031000003(31000003, Msg031000003.class),
    MSG_031000004(31000004, Msg031000004.class),
    MSG_031000005(31000005, Msg031000005.class),
    MSG_031000006(31000006, Msg031000006.class),
    MSG_031000007(31000007, Msg031000007.class),
    MSG_031000008(31000008, Msg031000008.class),
    MSG_031000009(31000009, Msg031000009.class),
    MSG_031000010(31000010, Msg031000010.class),
    MSG_031000011(31000011, Msg031000011.class),
    MSG_031000012(31000012, Msg031000012.class),
    MSG_032000001(32000001, Msg032000001.class),
    MSG_032000002(32000002, Msg032000002.class),
    MSG_032000003(32000003, Msg032000003.class),
    MSG_032000004(32000004, Msg032000004.class),
    MSG_032000005(32000005, Msg032000005.class),
    MSG_032000006(32000006, Msg032000006.class),
    MSG_032000007(32000007, Msg032000007.class),
    MSG_032000008(32000008, Msg032000008.class),
    MSG_032000009(32000009, Msg032000009.class),
    MSG_032000010(32000010, Msg032000010.class),
    MSG_032000011(32000011, Msg032000011.class),
    MSG_032000012(32000012, Msg032000012.class),

    MSG_041000001(41000001, Msg041000001.class),
    MSG_041000002(41000002, Msg041000002.class),
    MSG_042000001(42000001, Msg042000001.class),
    MSG_042000002(42000002, Msg042000002.class),

    MSG_051000001(51000001, Msg051000001.class),
    MSG_051000002(51000002, Msg051000002.class),
    MSG_051000003(51000003, Msg051000003.class),
    MSG_051000004(51000004, Msg051000004.class),
    MSG_051000005(51000005, Msg051000005.class),
    MSG_051000006(51000006, Msg051000006.class),
    MSG_051000007(51000007, Msg051000007.class),
    MSG_051000008(51000008, Msg051000008.class),
    MSG_051000009(51000009, Msg051000009.class),
    MSG_051000010(51000010, Msg051000010.class),
    MSG_051000011(51000011, Msg051000011.class),
    MSG_051000012(51000012, Msg051000012.class),
    MSG_051000013(51000013, Msg051000013.class),
    MSG_052000001(52000001, Msg052000001.class),
    MSG_052000002(52000002, Msg052000002.class),
    MSG_052000003(52000003, Msg052000003.class),
    MSG_052000004(52000004, Msg052000004.class),
    MSG_052000005(52000005, Msg052000005.class),
    MSG_052000006(52000006, Msg052000006.class),
    MSG_052000007(52000007, Msg052000007.class),
    MSG_052000008(52000008, Msg052000008.class),
    MSG_052000009(52000009, Msg052000009.class),
    MSG_052000010(52000010, Msg052000010.class),
    MSG_052000011(52000011, Msg052000011.class),
    MSG_052000012(52000012, Msg052000012.class),
    MSG_052000013(52000013, Msg052000013.class),

    MSG_061000001(61000001, Msg061000001.class),
    MSG_062000001(62000001, Msg062000001.class),
    ;
    private static Map<Integer, Class> map = new HashMap<Integer, Class>();
    static {
        for(MsgCode e : MsgCode.values()) {
            map.put(e.code, e.clazz);
        }
    }

    private final int code;
    private final Class clazz;

    private MsgCode(int code, Class clazz) {
        this.code = code;
        this.clazz = clazz;
    }

    public final int getCode() {
        return code;
    }

    public static Class get(int code) {
        return map.get(code);
    }
}
